<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@ page session="true" %>
<%@ page import="javax.portlet.*" %>
<%@page import ="rai.dto.*" %>
<%@page import ="rai.dao.*" %>
<%@page import = "java.util.*" %>

<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<portlet:defineObjects/>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Personal Information Tracking System</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<script type="text/javascript" src='<%= request.getContextPath() + "/js/calendarDateInput.js" %>'></script>
<script type="text/javascript">
    function getForm(namespace, name) {
        return document.forms[namespace + name];
    }
    function back_to_emp_info_form(namespace, name) {
        var frm = getForm(namespace, name);
        frm.txtAction.value = "back_to_empInfo_form_2";
        frm.submit();
    }
    function back_to_login(namespace, name) {
		var frm = getForm(namespace, name);
		frm.txtAction.value = "back_to_login_form";
		frm.submit();
	}
	function update_taken_prj_info(namespace,name){
		var frm = getForm(namespace, name);
		frm.txtAction.value = "update_taken_prj_info";
		frm.submit();
	}
</script>
<link href='<%=request.getContextPath() + "/css/style.css" %>' rel="stylesheet" type="text/css" media="screen" />
</head>

<body>
<form name="<portlet:namespace/>edittknprjForm" action="<portlet:actionURL/>" method="POST">
<input type="hidden" name="txtAction" />

<table align="center">
	<%ProjectEmpInfoDTO PrjInfo = (ProjectEmpInfoDTO) session.getAttribute("TakenProjectInfo"); 
	  String mess=(String) session.getAttribute("succMess");%>
	<tr class="title">
			<td colspan="2">		
					<h1><a href="#">Personal information tracking system </a></h1>
					<p>exploit the value of data</p>
					<hr />

			</td>
	</tr>
	<tr>	
		<td colspan="2" align="left"> Welcome, <font color="orange"/><b>[${sessionScope.role}]${sessionScope.name}</b></font>
		| <a href="#" onclick="back_to_emp_info_form('<portlet:namespace/>','edittknprjForm')">Home</a>
		| <a href="#" onclick="back_to_login('<portlet:namespace/>','edittknprjForm')">Logout</a>
			
	   </td>
	</tr>
	
	<tr>	
		<td>
			<table border="1">
				<tr>
					<td><h2 class="title">Project Experience  Information</h2></td>
				</tr>
				<tr>
					<td>
						<table border="1" width="100%">							
							<tr style="width: 435px">

							  <td align="left" valign="bottom" style="width: 188px">&nbsp;Project Name </td>
							  <td align="left" valign="middle" colspan="2" style="width: 183px"><%=PrjInfo.getSname() %></td>
							</tr><tr>
							  <td align="left" valign="bottom">&nbsp;Department&nbsp;</td>
							  <td align="left" valign="middle" colspan="2"><%=PrjInfo.getDept() %></td>
							</tr>
							
							<tr>
							<%  String path = request.getContextPath()+"/js";%>
							

							  <td align="left" valign="middle" rowspan="2">&nbsp;Working Period&nbsp;</td>
							  <td align="left" valign="bottom">From</td>
							  <td align="left" valign="middle">&nbsp;
										
										<script>DateInput('PeriodFrom', true, 'DD/MM/YYYY','<%=path%>','<%=PrjInfo.getStart()%>');</script>							  
							  </td>  							 
						  </tr>
						  <tr>
							  	<td align="left" valign="bottom">&nbsp;To&nbsp;</td>

						  		<td align="left" valign="bottom">&nbsp;
										<script>DateInput('PeriodTo', true, 'DD/MM/YYYY','<%=path%>','<%=PrjInfo.getEnd()%>');</script>
								</td>
						  </tr>
						  <tr>
							  	<td align="left" valign="bottom">&nbsp;Role&nbsp;</td>
								<td align="left" valign="middle" colspan="2"><select name="lstRole" style="width: 176px">
								<%EditTakenProjectDAO dao= new EditTakenProjectDAO();
								  List<RoleDTO> lst_role=dao.getRole();
								  for(int i=0; i<lst_role.size();i++){
								  RoleDTO temp = lst_role.get(i);
								  if(temp.getId()==Integer.parseInt(PrjInfo.getRole())){%>
								  
								  <option selected value='<%=temp.getId() %>'><%=temp.getSname() %></option>
								  <%}else{ %>
								  <option value='<%=temp.getId() %>'><%=temp.getSname() %></option>
								  <%}} %>
                                                                </select>
								</td>
						  </tr>
						  <tr>
						  	<td>&nbsp;More Description&nbsp;</td>

							<td colspan="2" style="height: 68px"><textarea name="txtDes" cols="4" rows="2" style="width: 187px; height: 71px"><%=PrjInfo.getDes() %></textarea></td>
						  </tr>

						  <tr align="left" valign="bottom">
						  	  <td colspan="3"><input type="button" name="btnUpdate" value="Update" onclick="update_taken_prj_info('<portlet:namespace/>','edittknprjForm')"/><input type="button" name="btnCancel" value="Cancel" onclick="back_to_emp_info_form('<portlet:namespace/>','edittknprjForm')"/><%=mess %></td>
						  </tr>
				    </table>					</td>
				</tr>

			</table>			
		</td>
	</tr>
	<tr>
		<td colspan="2">
			<div style="clear: both;">&nbsp;</div>
			<div id="footer"><p>Development by HCMUT-Group3.</p>
			</div>
		</td>

	</tr>
</table>
</form>
</body>
